# -- coding: utf-8 -- 
# Name: config

def py2():
    DIALECT = 'MySQL'
    DRIVER = 'MySQLdb'
    USERNAME = 'root'
    PASSWORD = ''
    HOST = '127.0.0.1'
    PORT = '3306'
    DATABASE = 'bd_demo1'
    SQLALCHEMY_DATABASE_URI="{}+{}://{}:{}@{}:{}/{}?charset=utf8".format(DIALECT,DRIVER,USERNAME,PASSWORD,HOST,PORT,DATABASE)
    SQLALCHEMY_TRACK_MODIFICATIONS = False
    SQLALCHEMY_ECHO = True

def py3():
    USERNAME = 'root'
    PASSWORD = 'root'
    HOST = '127.0.0.1'
    PORT = '3306'  # 设置端口号
    DATABASE = 'db_demo1'  # 设置访问的数据库
    DB_URI = 'MySQL+pyMySQL://{}:{}@{}:{}/{}?charset=utf8'.format(USERNAME, PASSWORD, HOST, PORT, DATABASE)  # 准备创建数据库连接示例
    SQLALCHEMY_DATABASE_URI = DB_URI  # 创建数据库连接示例
    SQLALCHEMY_TRACK_MODIFICATIONS = False  # 查询时会显示原始SQL语句
    SQLALCHEMY_ECHO = True





